{% extends "agent/base_agent.html" %}
{% load i18n %}
{% load properties %}

{% block agent_content %}

{% if sr_list %}
<form method='post' action='action/'>
{% csrf_token %}
<div class='actions'>
Action: 
  <select name='action'>
    <option value='' selected>-- Select an action --</option>
    <option value='print_pkg'>Print package(s)</option>
    <option value='change_status'>Change status</option>
  </select>
<button type='submit' class='button' title='Run selected action'>Apply</button>
</div>
<table>
  <tr>
  	<th><input type='checkbox'/></th>
    <th>Date</th>
    <th>File No</th>
    <th>Principal Applicant</th>
    <th>Visa Office</th>
    <th>Status</th>
  </tr>
  {% for sr in sr_list %}
  <tr>
  	<td><input type='checkbox'/></td>
    <td>{{ sr.date_requested|date:'d/m/Y' }}</td>
    <td><a href='{% url request_detail sr.reference_key %}'>{{ sr.file_no }}</a></td>
    <td>{{ sr.applicant_set.all.0 }}</td>
    <td>{{ sr.visa_office__name }}</td>
    <td>{{ sr.status }}</td>
  </tr>
  {% endfor %}
</table>
</form>
{% else %}
<h1>No new requests found!</h1>
{% endif %}

{% endblock %}
